package com.cjl.open.okhttp;

import java.util.concurrent.*;

public class OtherTest {
    public static void main(String[] args) {
        BlockingQueue<Runnable> queue = new SynchronousQueue<>();

        ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(0,Integer.MAX_VALUE,60, TimeUnit.SECONDS,queue);

        threadPoolExecutor.execute(()->{
            System.out.println("OtherTest.main 1 "+Thread.currentThread().getName());
            while (true){

            }
        });

        try {
            Thread.sleep(100);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        threadPoolExecutor.execute(()->{
            System.out.println("OtherTest.main 2 "+Thread.currentThread().getName());
        });

        try {
            Thread.sleep(100);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

        threadPoolExecutor.execute(()->{
            System.out.println("OtherTest.main 3 "+Thread.currentThread().getName());
        });

        while (true){

        }

    }
}
